<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>ADDX Instruction</title>
<link href="../edit68k.css" rel="stylesheet" type="text/css">
</head>

<body>
<h1 class="heading">ADDX Instruction<BR>
  </h1>
  <hr noshade></h1>
<BR>
          <span class="text">The instruction ADDX (ADD eXtended) works as ADD but the X flag is also added. This makes it possible to add big numbers stored in many bytes.<BR>
          <BR>
  The instruction has two methods:<BR>
          <BR>
  1. Add a data register to a data register.<BR>
  2. Add a memory location to another memory location. You must use -(An) on<BR>
  both operands then.<BR>
  <BR>
  ADDRESS METHODS: Dn, -(An)<BR>
  <BR>
  DATA LENGTH: Byte, word, longword</span></P>
          <TABLE border=0 cellPadding=0 cellSpacing=0 width="71%">
            <TBODY>
              <TR>
                <TD width="16%" rowSpan=5 vAlign=top class="text">FLAGS:</TD>
                <TD width="84%" class="text">X - Set if carry from the most significant bit, otherwise it is cleared.</TD>
              </TR>
              <TR>
                <TD width="84%" class="text">N - S</TD>
              </TR>
              <TR>
                <TD width="84%" class="text">Z - S</TD>
              </TR>
              <TR>
                <TD width="84%" class="text">C - Same as X</TD>
              </TR>
              <TR>
                <TD width="84%" class="text">V - S</TD>
              </TR>
            </TBODY>
          </TABLE>
          <P class="text">The Z flag works in another way now, making it possible to check if a big number (much bigger than 32 bits) is zero. You must set the zero flag before making the addition though, shorter than comparing a register with itself.</P>
          <TABLE border=0 cellPadding=0 cellSpacing=0 width="46%">
            <TBODY>
              <TR>
                <TD width="34%" rowSpan=2 class="text">SYNTAX:</TD>
                <TD width="66%" class="text">ADDX Dy,Dx</TD>
              </TR>
              <TR>
                <TD width="66%" class="text">ADDX -(Ay),-(Ax)</TD>
              </TR>
            </TBODY>
          </TABLE>
          <P><span class="text">EXAMPLE CODE:&nbsp;&nbsp;&nbsp; </span></P>
          <P class="sourcecode"><span class="text">&nbsp;&nbsp; ADDX&nbsp;&nbsp;&nbsp; D0,D1&nbsp;&nbsp;&nbsp; 
           
          Adds D0 and D1 + X bit.&nbsp; then clears the X bit</span></P>
          </body>
</html>